﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Blacklist.ascx.cs"
    Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.BlacklistControl" %>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-blacklist.png" alt="" />
        Manage blacklist
    </div>
    <div class="options">
        <asp:Button ID="btnAddBannedIP" runat="server" CssClass="adminButtonBlue" Text="Add banned IP" OnClick="btnAddBannedIP_Click"
            ToolTip="Add IP to blacklist" />
        <asp:Button ID="btnAddBannedNetwork" runat="server" CssClass="adminButtonBlue" Text="Add banned network" OnClick="btnAddBannedNetwork_Click"
            ToolTip="Add network to blacklist" />
    </div>
</div>
<p>
</p>
<ajaxToolkit:TabContainer runat="server" ID="tabBlacklist" ActiveTabIndex="0">
    <ajaxToolkit:TabPanel runat="server" ID="pagIpAddress" HeaderText="IP addresses">
        <ContentTemplate>
            <asp:GridView ID="gvBannedIpAddress" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:BoundField DataField="BannedIpAddressID" HeaderText="ID" Visible="False"></asp:BoundField>
                    <asp:TemplateField HeaderText="IP address" ItemStyle-Width="20%">
                        <ItemTemplate>
                            <a href="BlacklistIPDetails.aspx?BannedIpAddressID=<%#Eval("BannedIpAddressID")%>"
                                title="Edit IP address">
                                <%#Server.HtmlEncode(Eval("Address").ToString())%>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Comment" HeaderText="Comment" ItemStyle-Width="40%"></asp:BoundField>
                    <asp:TemplateField HeaderText="Created on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
                        ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Updated on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
                        ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("UpdatedOn")).ToString()%>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
    </ajaxToolkit:TabPanel>
    <ajaxToolkit:TabPanel runat="server" ID="pagIpNetwork" HeaderText="IP networks">
        <ContentTemplate>
            <asp:GridView ID="gvBannedIpNetwork" runat="server" AutoGenerateColumns="False" Width="100%">
                <Columns>
                    <asp:BoundField DataField="BannedIpNetworkID" HeaderText="ID" Visible="False"></asp:BoundField>
                    <asp:TemplateField HeaderText="IP range" ItemStyle-Width="20%">
                        <ItemTemplate>
                            <a href="BlacklistNetworkDetails.aspx?BannedIpNetworkID=<%#Eval("BannedIpNetworkID")%>"
                                title="Edit IP address">
                                <%#Server.HtmlEncode(Eval("StartAddress").ToString())%>-<%#Server.HtmlEncode(Eval("EndAddress").ToString())%>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Comment" HeaderText="Comment" ItemStyle-Width="20%"></asp:BoundField>
                    <asp:BoundField DataField="IpException" HeaderText="IP exceptions" ItemStyle-Width="20%"></asp:BoundField>
                    <asp:TemplateField HeaderText="Created on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
                        ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Updated on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
                        ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("UpdatedOn")).ToString()%>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
    </ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>